package com.wangshouyu.mp.pay.scene;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.util.Objects;

/**
 * @author 王守钰
 * @description 场景信息
 * @date 2020/8/13 9:18
 */
public class SceneInfo<H5 extends H5SceneInfo, Store extends StoreSceneInfo> {

    /**
     * h5场景信息
     */
    @SerializedName(value = "h5_info")
    @JsonProperty(value = "h5_info")
    @JSONField(name = "h5_info")
    private H5 h5Info;

    /**
     * 门店信息
     */
    @SerializedName(value = "store_info")
    @JsonProperty(value = "store_info")
    @JSONField(name = "store_info")
    private Store storeInfo;

    public H5 getH5Info() {
        return h5Info;
    }

    public void setH5Info(H5 h5Info) {
        this.h5Info = h5Info;
    }

    public Store getStoreInfo() {
        return storeInfo;
    }

    public void setStoreInfo(Store storeInfo) {
        this.storeInfo = storeInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SceneInfo<?, ?> sceneInfo = (SceneInfo<?, ?>) o;
        return Objects.equals(h5Info, sceneInfo.h5Info) &&
                Objects.equals(storeInfo, sceneInfo.storeInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(h5Info, storeInfo);
    }

    @Override
    public String toString() {
        return "SceneInfo{" +
                "h5Info=" + h5Info +
                ", storeInfo=" + storeInfo +
                '}';
    }
}
